package com.xianyu.us.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xianyu.us.common.utils.ShiroUtils;
import com.xianyu.us.pojo.vo.JsonResult;
import com.xianyu.us.service.UsGoodsService;
import com.xianyu.us.service.UsUserService;


@RequestMapping("/myInfo/")
@RestController
public class MyInfoController {
	@Autowired
	private UsUserService usUserService;
	@Autowired
	private UsGoodsService usGoodsService;

	@RequestMapping("doFindPageObjects")
	public JsonResult doFindPageObjects() {
		return new JsonResult(usUserService.findByUsername(ShiroUtils.getUsername()));

	}

	@RequestMapping("doPurchaseGoods")
	public JsonResult doPurchaseGoods(Integer buyeId) {
		return new JsonResult(usGoodsService.findByGoods(buyeId));
	}
}
